package com.xhs.minio.core.config;

import com.xhs.minio.core.props.MinioPropertiesParam;
import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @desc: minio 客户端配置
 * @projectName: spring-boot-minio
 * @author: xhs
 * @date: 2025-08-16 周六 17:59
 */
@Configuration
public class MinIoClientConfig {

    @Bean
    public MinioClient minioClient(MinioPropertiesParam minioProps) {
        // 注入minio 客户端
        return MinioClient.builder()
                .endpoint(minioProps.getEndpoint())
                .credentials(minioProps.getAccessKey(), minioProps.getSecretKey())
                .build();
    }
}
